<#assign tit>合同内审</#assign>
<@page.html title=tit>
<script type="text/javascript">
  function audit(r) {
    var fm = getEl("fm_input");
    var note = fm.reviewNote.value;
    if(r==3 && note=="") {
      window.alert("请填写退回原因");
      return;
    }
    if(r==5 && note=="") {
      window.alert("请填写需要处理内容");
      return;
    }
    if(!window.confirm("确定"+(r==4?"通过":(r==3?"退回":(r==2?"转内审":"需要处理")))+"?")) return;
    fm.reviewResult.value = r;
    post(fm);
  }
  function chgVerify(sid) {
    getJson("_chgverify?tp=1&id="+sid, function(data) {
      window.alert(data.msg);
      if(data.ret) window.location = window.location;
    });
  }
</script>
<div style="width:900px;">
  <div class="kbox">
    <form id="fm_input" method="post" action="_review${contract.reviewStatus}" onsubmit="return post(this);">
      <input type="hidden" name="saleId" value="${contract.saleId}">
      <input type="hidden" name="saleType" value="${type!}">
      <input type="hidden" name="reviewResult" value="">
      <#include "info.ftl">
      <table class="input noprint" style="margin-left:80px;">
        <tr>
          <th>审批意见</th>
          <td><textarea name="reviewNote" cols="40" rows="3"></textarea></td>
        </tr>
      </table>
    </form>
  </div>
  <div class="button noprint"><!--input type="button" value="打印" onclick="window.print();" style="float:left;"-->
    <input type="button" value="通过" onclick="audit(4);">
    <input type="button" value="明显错误退回" onclick="audit(3);">
    <#if contract.reviewStatus=1><input type="button" value="转内审" onclick="audit(2);"></#if>
    <#if contract.reviewStatus=2><input type="button" value="需要处理" onclick="audit(5);"></#if></div>
</div>
</@page.html>